import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xiaotutu
 * Date: 2023-09-02
 * Time: 14:18
 */
public class Test {
    public static void main(String[] args) {
        //写一个函数返回参数二进制中 1 的个数
        // 比如： 15       0000 1111       4 个 1
        Scanner in = new Scanner(System.in);
        System.out.println("请输入数字:");
        while(in.hasNextInt()) {
            int n = in.nextInt();
            while() {

            }
        }
    }
    public static void main10(String[] args) {
        //求出0～999之间的所有“水仙花数”并输出。
        // (“水仙花数”是指一个三位数，其各位数字的立方和确好等于该数本身，
        // 如：153＝1^3＋5^3＋3^3，则153是一个“水仙花数”。)

        int tmp = 0;
        for (int i = 100; i <= 99999; i++) {
            tmp = i;
            int count = 1;
            int sum = 0;
            while (tmp / 10 != 0) {
                count++;
                tmp /= 10;
            }
            tmp = i;
            while (tmp != 0) {
                sum += Math.pow(tmp % 10, count);
                tmp /= 10;
            }
            if(sum == i) {
                System.out.print(i+ " ");
            }
        }

    }
    public static void main9(String[] args) {
        //求两个正整数的最大公约数
        int a = 20;
        int b = 40;
        int m = 1;
        while(a % b != 0) {
            m = a % b;
            a = b;
            b = m;
        }
        System.out.println(b);
    }
    public static void main8(String[] args) {
        //输出 1000 - 2000 之间所有的闰年
        for (int y = 1000; y <= 2000; y++) {
            if(y % 400 ==0 || y % 4 ==0 && y % 100 !=0) {
                System.out.print(y+" ");
            }
        }
    }
    public static void main7(String[] args) {
        //打印 1 - 100 之间所有的素数
        for (int i = 1; i <= 100; i++) {
            int j = 0;
            for (j = 2; j <= Math.sqrt(i); j++) {
                if(i % j == 0) {
                    break;
                }
            }
            if(j > Math.sqrt(i)) {
                System.out.print(i + " ");
            }
        }
    }
    public static void main6(String[] args) {
        //判定一个数字是否是素数
        Scanner in = new Scanner(System.in);
        while(in.hasNextInt()) {
            int a = in.nextInt();
            int i = 0;
            for (i = 2; i <= Math.sqrt(a); i++) {
                if(a % i ==0) {
                    System.out.println("不是素数");
                    break;
                }
            }
            if(i > Math.sqrt(a)) {
                System.out.println("是素数");
            }
        }
    }
    public static void main5(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("输入你的姓名:");
        String name = in.nextLine();
        System.out.println(name);
        System.out.println("输入一个整数:");
        int a = in.nextInt();
        System.out.println(a);


    }
    public static void main4(String[] args) {
        for (int i = 1; i <= 100; i++) {
            if(i % 5 == 0 && i % 6 == 0) {
                System.out.println(i+" ");
                continue;
            }
        }
    }
    public static void main3(String[] args) {
        //找到 100 - 200 中所有 3 的倍数
        for (int i = 100; i <= 200; i++) {
            if(i % 3 ==0) {
                System.out.print(i+" ");
                continue;
            }
        }
    }
    public static void main2(String[] args) {
        //找到 100 - 200 中第一个 3 的倍数
        for (int i = 100; i <= 200; i++) {
            if(i % 3 ==0) {
                System.out.println(i);
                break;
            }
        }
    }
    public static void main1(String[] args) {
        int a = 10;
        String str = String.valueOf(a);
        String str1 = "12345";
        int b = Integer.parseInt(str1);
        System.out.println(str);
        System.out.println(b);
    }
}
